﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_NhanDuLieuTuChiNhanh : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvChiNhanh")]
        private ADVObjects _AdvChiNhanh;
        [AccessedThroughProperty("CboServer")]
        private ComboBox _CboServer;
        [AccessedThroughProperty("CKGhiDe")]
        private CheckBox _CKGhiDe;
        [AccessedThroughProperty("CKSoDuDauKy")]
        private CheckBox _CKSoDuDauKy;
        [AccessedThroughProperty("CKSoDuDauKyTaiKhoan")]
        private CheckBox _CKSoDuDauKyTaiKhoan;
        [AccessedThroughProperty("CmdAnThongTinKetNoi")]
        private Button _CmdAnThongTinKetNoi;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdLuuThongTinSQL")]
        private Button _CmdLuuThongTinSQL;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("CmdShowThongTinKeNoi")]
        private Button _CmdShowThongTinKeNoi;
        [AccessedThroughProperty("CmdTest")]
        private Button _CmdTest;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("TabPage3")]
        private TabPage _TabPage3;
        [AccessedThroughProperty("TxtDatabase")]
        private TextBox _TxtDatabase;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtPassword")]
        private TextBox _TxtPassword;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("TxtUserName")]
        private TextBox _TxtUserName;
        [AccessedThroughProperty("updNam")]
        private NumericUpDown _updNam;
        [AccessedThroughProperty("updThang")]
        private NumericUpDown _updThang;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        [AccessedThroughProperty("VSListDanhMuc")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSListDanhMuc;
        private IContainer components;
        private clsDuLieuChiNhanh objDLCN;
        private string strKhoaDoiTuong;

        public Frm_NhanDuLieuTuChiNhanh()
        {
            base.Load += new EventHandler(this.Frm_NhanDuLieuTuChiNhanh_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objDLCN = new clsDuLieuChiNhanh();
            this.strKhoaDoiTuong = "";
            this.InitializeComponent();
        }

        private void AdvChiNhanh_ValueChanged(object sender, EventArgs e)
        {
            this.ShowDataServer();
        }

        private void CmdAnThongTinKetNoi_Click(object sender, EventArgs e)
        {
            this.Height = 380;
            this.CenterToScreen();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdLuuThongTinSQL_Click(object sender, EventArgs e)
        {
            clsDuLieuChiNhanh objDLCN = this.objDLCN;
            objDLCN.TenMayChu = this.CboServer.Text.Trim();
            objDLCN.TenDataBase = this.TxtDatabase.Text.Trim();
            objDLCN.NguoiDung = this.TxtUserName.Text;
            objDLCN.MatKhau = this.TxtPassword.Text;
            objDLCN.Loai = 1;
            objDLCN.Save();
            objDLCN = null;
            this.CmdAnThongTinKetNoi_Click(this.CmdAnThongTinKetNoi, e);
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            switch (this.TabControl1.SelectedIndex)
            {
                case 0:
                    this.NhanDuLieuNghiepVu();
                    break;

                case 1:
                    this.NhanDuLieuDanhMuc();
                    break;
            }
        }

        private void CmdShowThongTinKeNoi_Click(object sender, EventArgs e)
        {
            this.Height = 540;
            this.CenterToScreen();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void FillDanhMuc()
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSListDanhMuc = this.VSListDanhMuc;
            vSListDanhMuc.Rows.Count = 8;
            vSListDanhMuc[1, 0] = "DM_TaiKhoan";
            vSListDanhMuc[1, 2] = "T\x00e0i khoản";
            vSListDanhMuc[2, 0] = "DM_DoiTuong";
            vSListDanhMuc[2, 2] = "Đối tượng (Nh\x00e0 cung cấp, Kh\x00e1ch h\x00e0ng, Ng\x00e2n h\x00e0ng, Nh\x00e2n vi\x00ean)";
            vSListDanhMuc[3, 0] = "DM_NhomHangHoa";
            vSListDanhMuc[3, 2] = "Danh mục nh\x00f3m h\x00e0ng h\x00f3a";
            vSListDanhMuc[4, 0] = "DM_HangHoa";
            vSListDanhMuc[4, 2] = "Danh mục h\x00e0ng h\x00f3a";
            vSListDanhMuc[5, 0] = "DM_LoaiTien";
            vSListDanhMuc[5, 2] = "Danh mục loại tiền";
            vSListDanhMuc[6, 0] = "DM_DonViTinh";
            vSListDanhMuc[6, 2] = "Danh mục đơn vị t\x00ednh";
            vSListDanhMuc[7, 0] = "DM_Kho";
            vSListDanhMuc[7, 2] = "Kho h\x00e0ng";
            vSListDanhMuc = null;
        }

        public void FillNghiepVu()
        {
            string commandText = " SELECT DienGiai, BangCha, BangCon, TenFieldCha, BatBuoc FROM HT_NhanDuLieu ";
            DataTable table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
            C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
            vSList.Rows.Count = 1;
            vSList.Cols.Count = 6;
            vSList.Cols[3].Visible = false;
            vSList.Cols[4].Visible = false;
            vSList.Cols[5].Visible = false;
            int num2 = table.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                vSList.AddItem("");
                vSList[vSList.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(table.Rows[i]["BangCha"]);
                vSList[vSList.Rows.Count - 1, 1] = 1;
                vSList[vSList.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(table.Rows[i]["DienGiai"]);
                vSList[vSList.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(table.Rows[i]["BangCon"]);
                vSList[vSList.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TenFieldCha"]);
                vSList[vSList.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(table.Rows[i]["BatBuoc"]);
            }
            vSList = null;
        }

        private void Frm_NhanDuLieuTuChiNhanh_Load(object sender, EventArgs e)
        {
            string commandText = " SELECT TOP 1 KhoaDoiTuong FROM HT_DataClient WHERE Loai = 1 ";
            this.strKhoaDoiTuong = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(DBHelper.ExecuteScalar(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0])), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            this.AdvChiNhanh.Value = this.strKhoaDoiTuong;
            this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
            this.FillDanhMuc();
            this.FillNghiepVu();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_NhanDuLieuTuChiNhanh));
            this.CmdOK = new Button();
            this.Label2 = new Label();
            this.Label1 = new Label();
            this.TxtDenNgay = new DateTimePicker();
            this.Label13 = new Label();
            this.Panel1 = new Panel();
            this.AdvChiNhanh = new ADVObjects();
            this.CKGhiDe = new CheckBox();
            this.TxtTuNgay = new DateTimePicker();
            this.TabControl1 = new TabControl();
            this.TabPage1 = new TabPage();
            this.VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TabPage2 = new TabPage();
            this.VSListDanhMuc = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TabPage3 = new TabPage();
            this.updNam = new NumericUpDown();
            this.Label4 = new Label();
            this.updThang = new NumericUpDown();
            this.CKSoDuDauKyTaiKhoan = new CheckBox();
            this.CKSoDuDauKy = new CheckBox();
            this.CmdCancel = new Button();
            this.GroupBox1 = new GroupBox();
            this.CboServer = new ComboBox();
            this.Label3 = new Label();
            this.TxtPassword = new TextBox();
            this.Label5 = new Label();
            this.TxtUserName = new TextBox();
            this.Label6 = new Label();
            this.TxtDatabase = new TextBox();
            this.Label7 = new Label();
            this.CmdAnThongTinKetNoi = new Button();
            this.CmdShowThongTinKeNoi = new Button();
            this.CmdLuuThongTinSQL = new Button();
            this.CmdTest = new Button();
            this.Panel1.SuspendLayout();
            this.TabControl1.SuspendLayout();
            this.TabPage1.SuspendLayout();
            this.VSList.BeginInit();
            this.TabPage2.SuspendLayout();
            this.VSListDanhMuc.BeginInit();
            this.TabPage3.SuspendLayout();
            this.updNam.BeginInit();
            this.updThang.BeginInit();
            this.GroupBox1.SuspendLayout();
            this.SuspendLayout();
            Point point = new Point(0x10f, 0x143);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            Size size = new Size(0x58, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 0;
            this.CmdOK.Text = "Nhận dữ liệu";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(12, 0x22);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x37, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x85;
            this.Label2.Text = "Chi nh\x00e1nh";
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0x9f, 10);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x34, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x83;
            this.Label1.Text = "đến ng\x00e0y";
            this.TxtDenNgay.Format = DateTimePickerFormat.Custom;
            point = new Point(0xd9, 6);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x55, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 130;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(11, 10);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x81;
            this.Label13.Text = "Từ ng\x00e0y";
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.AdvChiNhanh);
            this.Panel1.Controls.Add(this.CKGhiDe);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Dock = DockStyle.Top;
            point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x1cd, 0x36);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x86;
            this.AdvChiNhanh.Conditions = "";
            this.AdvChiNhanh.LoaiDoiTuong = modGeneral.TypeObjects.TatCa;
            point = new Point(0x49, 30);
            this.AdvChiNhanh.Location = point;
            this.AdvChiNhanh.Name = "AdvChiNhanh";
            this.AdvChiNhanh.ReadOnly = false;
            size = new Size(0x153, 20);
            this.AdvChiNhanh.Size = size;
            this.AdvChiNhanh.TabIndex = 0x87;
            this.AdvChiNhanh.UpperText = true;
            this.AdvChiNhanh.Value = "";
            this.AdvChiNhanh.WidthCode = 80;
            this.CKGhiDe.AutoSize = true;
            this.CKGhiDe.BackColor = Color.Transparent;
            point = new Point(0x147, 7);
            this.CKGhiDe.Location = point;
            this.CKGhiDe.Name = "CKGhiDe";
            size = new Size(0x5c, 0x11);
            this.CKGhiDe.Size = size;
            this.CKGhiDe.TabIndex = 0x86;
            this.CKGhiDe.Text = "Ghi đ\x00e8 dữ liệu";
            this.CKGhiDe.UseVisualStyleBackColor = false;
            this.TxtTuNgay.Format = DateTimePickerFormat.Custom;
            point = new Point(0x49, 6);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x53, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x80;
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Controls.Add(this.TabPage2);
            this.TabControl1.Controls.Add(this.TabPage3);
            this.TabControl1.Dock = DockStyle.Top;
            point = new Point(0, 0x36);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x1cd, 0x10a);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 0x87;
            this.TabPage1.Controls.Add(this.VSList);
            point = new Point(4, 0x16);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            Padding padding = new Padding(3);
            this.TabPage1.Padding = padding;
            size = new Size(0x1c5, 240);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Ph\x00e1t sinh";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.VSList.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSList.ColumnInfo = manager.GetString("VSList.ColumnInfo");
            this.VSList.Cursor = Cursors.Default;
            this.VSList.Dock = DockStyle.Fill;
            this.VSList.ExtendLastCol = true;
            this.VSList.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSList.Location = point;
            padding = new Padding(0);
            this.VSList.Margin = padding;
            this.VSList.Name = "VSList";
            this.VSList.Rows.Count = 1;
            this.VSList.Rows.DefaultSize = 0x11;
            size = new Size(0x1bf, 0xea);
            this.VSList.Size = size;
            this.VSList.StyleInfo = manager.GetString("VSList.StyleInfo");
            this.VSList.TabIndex = 0x88;
            this.VSList.Tag = "BH-0000";
            this.VSList.VisualStyle = VisualStyle.Office2007Blue;
            this.TabPage2.Controls.Add(this.VSListDanhMuc);
            point = new Point(4, 0x16);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            padding = new Padding(3);
            this.TabPage2.Padding = padding;
            size = new Size(0x1c5, 240);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 1;
            this.TabPage2.Text = "Danh mục";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.VSListDanhMuc.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSListDanhMuc.ColumnInfo = manager.GetString("VSListDanhMuc.ColumnInfo");
            this.VSListDanhMuc.Cursor = Cursors.Default;
            this.VSListDanhMuc.Dock = DockStyle.Fill;
            this.VSListDanhMuc.ExtendLastCol = true;
            this.VSListDanhMuc.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSListDanhMuc.Location = point;
            padding = new Padding(0);
            this.VSListDanhMuc.Margin = padding;
            this.VSListDanhMuc.Name = "VSListDanhMuc";
            this.VSListDanhMuc.Rows.Count = 1;
            this.VSListDanhMuc.Rows.DefaultSize = 0x11;
            size = new Size(0x1bf, 0xea);
            this.VSListDanhMuc.Size = size;
            this.VSListDanhMuc.StyleInfo = manager.GetString("VSListDanhMuc.StyleInfo");
            this.VSListDanhMuc.TabIndex = 0x88;
            this.VSListDanhMuc.Tag = "BH-0000";
            this.VSListDanhMuc.VisualStyle = VisualStyle.Office2007Blue;
            this.TabPage3.Controls.Add(this.updNam);
            this.TabPage3.Controls.Add(this.Label4);
            this.TabPage3.Controls.Add(this.updThang);
            this.TabPage3.Controls.Add(this.CKSoDuDauKyTaiKhoan);
            this.TabPage3.Controls.Add(this.CKSoDuDauKy);
            point = new Point(4, 0x16);
            this.TabPage3.Location = point;
            this.TabPage3.Name = "TabPage3";
            padding = new Padding(3);
            this.TabPage3.Padding = padding;
            size = new Size(0x1c5, 240);
            this.TabPage3.Size = size;
            this.TabPage3.TabIndex = 2;
            this.TabPage3.Text = "Số dư đầu kỳ";
            this.TabPage3.UseVisualStyleBackColor = true;
            point = new Point(0xcf, 40);
            this.updNam.Location = point;
            decimal num = new decimal(new int[] { 0x9c4, 0, 0, 0 });
            this.updNam.Maximum = num;
            num = new decimal(new int[] { 0x7d0, 0, 0, 0 });
            this.updNam.Minimum = num;
            this.updNam.Name = "updNam";
            size = new Size(0x3a, 20);
            this.updNam.Size = size;
            this.updNam.TabIndex = 14;
            num = new decimal(new int[] { 0x7d0, 0, 0, 0 });
            this.updNam.Value = num;
            this.Label4.AutoSize = true;
            point = new Point(0x54, 0x2a);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x3d, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 13;
            this.Label4.Text = "Th\x00e1ng năm";
            point = new Point(0x9e, 40);
            this.updThang.Location = point;
            num = new decimal(new int[] { 12, 0, 0, 0 });
            this.updThang.Maximum = num;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang.Minimum = num;
            this.updThang.Name = "updThang";
            size = new Size(0x2d, 20);
            this.updThang.Size = size;
            this.updThang.TabIndex = 12;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.updThang.Value = num;
            this.CKSoDuDauKyTaiKhoan.AutoSize = true;
            point = new Point(0x9f, 0x68);
            this.CKSoDuDauKyTaiKhoan.Location = point;
            this.CKSoDuDauKyTaiKhoan.Name = "CKSoDuDauKyTaiKhoan";
            size = new Size(0x89, 0x11);
            this.CKSoDuDauKyTaiKhoan.Size = size;
            this.CKSoDuDauKyTaiKhoan.TabIndex = 1;
            this.CKSoDuDauKyTaiKhoan.Text = "Số dư đầu kỳ t\x00e0i khoản";
            this.CKSoDuDauKyTaiKhoan.UseVisualStyleBackColor = true;
            this.CKSoDuDauKy.AutoSize = true;
            point = new Point(0x9f, 0x48);
            this.CKSoDuDauKy.Location = point;
            this.CKSoDuDauKy.Name = "CKSoDuDauKy";
            size = new Size(0x8a, 0x11);
            this.CKSoDuDauKy.Size = size;
            this.CKSoDuDauKy.TabIndex = 0;
            this.CKSoDuDauKy.Text = "Số dư đầu kỳ h\x00e0ng h\x00f3a";
            this.CKSoDuDauKy.UseVisualStyleBackColor = true;
            point = new Point(0x171, 0x143);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x58, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x88;
            this.CmdCancel.Text = "Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.GroupBox1.Controls.Add(this.CboServer);
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.TxtPassword);
            this.GroupBox1.Controls.Add(this.Label5);
            this.GroupBox1.Controls.Add(this.TxtUserName);
            this.GroupBox1.Controls.Add(this.Label6);
            this.GroupBox1.Controls.Add(this.TxtDatabase);
            this.GroupBox1.Controls.Add(this.Label7);
            point = new Point(4, 0x160);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(450, 0x7f);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0x89;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "Th\x00f4ng tin kết nối cơ sở dữ liệu SQL";
            this.CboServer.FormattingEnabled = true;
            point = new Point(0x97, 0x17);
            this.CboServer.Location = point;
            this.CboServer.Name = "CboServer";
            size = new Size(0xe9, 0x15);
            this.CboServer.Size = size;
            this.CboServer.TabIndex = 0x2c;
            this.Label3.AutoSize = true;
            point = new Point(0x4f, 0x68);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x35, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x2b;
            this.Label3.Text = "Password";
            point = new Point(0x97, 0x65);
            this.TxtPassword.Location = point;
            this.TxtPassword.Name = "TxtPassword";
            this.TxtPassword.PasswordChar = '*';
            size = new Size(0xe9, 20);
            this.TxtPassword.Size = size;
            this.TxtPassword.TabIndex = 0x2a;
            this.Label5.AutoSize = true;
            point = new Point(0x4f, 0x4e);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x3a, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x29;
            this.Label5.Text = "User name";
            point = new Point(0x97, 0x4b);
            this.TxtUserName.Location = point;
            this.TxtUserName.Name = "TxtUserName";
            size = new Size(0xe9, 20);
            this.TxtUserName.Size = size;
            this.TxtUserName.TabIndex = 40;
            this.Label6.AutoSize = true;
            point = new Point(0x4f, 0x34);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x35, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x27;
            this.Label6.Text = "Database";
            point = new Point(0x97, 0x31);
            this.TxtDatabase.Location = point;
            this.TxtDatabase.Name = "TxtDatabase";
            size = new Size(0xe9, 20);
            this.TxtDatabase.Size = size;
            this.TxtDatabase.TabIndex = 0x26;
            this.Label7.AutoSize = true;
            point = new Point(0x4f, 0x1a);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x43, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x25;
            this.Label7.Text = "Server name";
            point = new Point(4, 0x1e2);
            this.CmdAnThongTinKetNoi.Location = point;
            this.CmdAnThongTinKetNoi.Name = "CmdAnThongTinKetNoi";
            size = new Size(0x2d, 0x18);
            this.CmdAnThongTinKetNoi.Size = size;
            this.CmdAnThongTinKetNoi.TabIndex = 0x8a;
            this.CmdAnThongTinKetNoi.Text = "<<";
            this.CmdAnThongTinKetNoi.UseVisualStyleBackColor = true;
            point = new Point(4, 0x143);
            this.CmdShowThongTinKeNoi.Location = point;
            this.CmdShowThongTinKeNoi.Name = "CmdShowThongTinKeNoi";
            size = new Size(0x2d, 0x18);
            this.CmdShowThongTinKeNoi.Size = size;
            this.CmdShowThongTinKeNoi.TabIndex = 0x8b;
            this.CmdShowThongTinKeNoi.Text = "<<";
            this.CmdShowThongTinKeNoi.UseVisualStyleBackColor = true;
            point = new Point(0x16e, 0x1e2);
            this.CmdLuuThongTinSQL.Location = point;
            this.CmdLuuThongTinSQL.Name = "CmdLuuThongTinSQL";
            size = new Size(0x58, 0x18);
            this.CmdLuuThongTinSQL.Size = size;
            this.CmdLuuThongTinSQL.TabIndex = 140;
            this.CmdLuuThongTinSQL.Text = "Lưu";
            this.CmdLuuThongTinSQL.UseVisualStyleBackColor = true;
            point = new Point(0x110, 0x1e2);
            this.CmdTest.Location = point;
            this.CmdTest.Name = "CmdTest";
            size = new Size(0x58, 0x18);
            this.CmdTest.Size = size;
            this.CmdTest.TabIndex = 0x8d;
            this.CmdTest.Text = "Kiểm tra";
            this.CmdTest.UseVisualStyleBackColor = true;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            size = new Size(0x1cd, 0x15d);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.CmdTest);
            this.Controls.Add(this.CmdLuuThongTinSQL);
            this.Controls.Add(this.CmdShowThongTinKeNoi);
            this.Controls.Add(this.CmdAnThongTinKetNoi);
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.CmdOK);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_NhanDuLieuTuChiNhanh";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "NHAN DU LIEU TU CHI NHANH";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.TabControl1.ResumeLayout(false);
            this.TabPage1.ResumeLayout(false);
            this.VSList.EndInit();
            this.TabPage2.ResumeLayout(false);
            this.VSListDanhMuc.EndInit();
            this.TabPage3.ResumeLayout(false);
            this.TabPage3.PerformLayout();
            this.updNam.EndInit();
            this.updThang.EndInit();
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.ResumeLayout(false);
        }

        public static bool IsAccountActive(int userAccountControl)
        {
            int num = Convert.ToInt32(2);
            int num2 = userAccountControl & num;
            if (num2 > 0)
            {
                return false;
            }
            return true;
        }

        public void NhanDuLieuDanhMuc()
        {
            this.Cursor = Cursors.WaitCursor;
            int num2 = this.VSListDanhMuc.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSListDanhMuc[i, 1])) != 0.0)
                {
                    SQLBulkModules.BulkDanhMuc(Conversions.ToString(this.VSListDanhMuc[i, 0]), "");
                }
            }
            LVYModule.ShowWarning(modGeneral.Tranlated("Nghiệp vụ ho\x00e0n tất.", ""));
            this.Cursor = Cursors.Default;
        }

        public void NhanDuLieuNghiepVu()
        {
            this.Cursor = Cursors.WaitCursor;
            int num2 = this.VSListDanhMuc.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSList[i, 1])) != 0.0)
                {
                    SQLBulkModules.BulkNghiepVuBangCha(Conversions.ToString(this.VSList[i, 0]), LVYModule.Date2Char(this.TxtTuNgay.Text), LVYModule.Date2Char(this.TxtDenNgay.Text), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                }
            }
            this.Cursor = Cursors.Default;
            LVYModule.ShowWarning("Nhận dữ liệu từ chi nh\x00e1nh " + this.AdvChiNhanh.TxtName.Text + " về trung t\x00e2m ho\x00e0n tất.");
        }

        public void ShowDataServer()
        {
            clsDuLieuChiNhanh objDLCN = this.objDLCN;
            objDLCN.Load(this.AdvChiNhanh.Value, 1);
            this.CboServer.Text = objDLCN.TenMayChu;
            this.TxtDatabase.Text = objDLCN.TenDataBase;
            this.TxtUserName.Text = objDLCN.NguoiDung;
            this.TxtPassword.Text = objDLCN.MatKhau;
            objDLCN = null;
        }

        private void VSList_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (e.Col != 1)
            {
                e.Cancel = true;
            }
        }

        internal virtual ADVObjects AdvChiNhanh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvChiNhanh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvChiNhanh_ValueChanged);
                if (this._AdvChiNhanh != null)
                {
                    this._AdvChiNhanh.ValueChanged -= handler;
                }
                this._AdvChiNhanh = value;
                if (this._AdvChiNhanh != null)
                {
                    this._AdvChiNhanh.ValueChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboServer
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboServer;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboServer = value;
            }
        }

        internal virtual CheckBox CKGhiDe
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKGhiDe;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKGhiDe = value;
            }
        }

        internal virtual CheckBox CKSoDuDauKy
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKSoDuDauKy;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKSoDuDauKy = value;
            }
        }

        internal virtual CheckBox CKSoDuDauKyTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKSoDuDauKyTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKSoDuDauKyTaiKhoan = value;
            }
        }

        internal virtual Button CmdAnThongTinKetNoi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAnThongTinKetNoi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAnThongTinKetNoi_Click);
                if (this._CmdAnThongTinKetNoi != null)
                {
                    this._CmdAnThongTinKetNoi.Click -= handler;
                }
                this._CmdAnThongTinKetNoi = value;
                if (this._CmdAnThongTinKetNoi != null)
                {
                    this._CmdAnThongTinKetNoi.Click += handler;
                }
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdLuuThongTinSQL
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdLuuThongTinSQL;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdLuuThongTinSQL_Click);
                if (this._CmdLuuThongTinSQL != null)
                {
                    this._CmdLuuThongTinSQL.Click -= handler;
                }
                this._CmdLuuThongTinSQL = value;
                if (this._CmdLuuThongTinSQL != null)
                {
                    this._CmdLuuThongTinSQL.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual Button CmdShowThongTinKeNoi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdShowThongTinKeNoi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdShowThongTinKeNoi_Click);
                if (this._CmdShowThongTinKeNoi != null)
                {
                    this._CmdShowThongTinKeNoi.Click -= handler;
                }
                this._CmdShowThongTinKeNoi = value;
                if (this._CmdShowThongTinKeNoi != null)
                {
                    this._CmdShowThongTinKeNoi.Click += handler;
                }
            }
        }

        internal virtual Button CmdTest
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTest;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdTest = value;
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual TabPage TabPage3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage3 = value;
            }
        }

        internal virtual TextBox TxtDatabase
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDatabase;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDatabase = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual TextBox TxtPassword
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtPassword;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtPassword = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTuNgay = value;
            }
        }

        internal virtual TextBox TxtUserName
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtUserName;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtUserName = value;
            }
        }

        internal virtual NumericUpDown updNam
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updNam;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._updNam = value;
            }
        }

        internal virtual NumericUpDown updThang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._updThang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._updThang = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSList_BeforeEdit);
                if (this._VSList != null)
                {
                    this._VSList.BeforeEdit -= handler;
                }
                this._VSList = value;
                if (this._VSList != null)
                {
                    this._VSList.BeforeEdit += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSListDanhMuc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSListDanhMuc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSListDanhMuc = value;
            }
        }

        public enum ADAccountOptions
        {
            UF_ACCOUNT_LOCKOUT = 0x10,
            UF_ACCOUNTDISABLE = 2,
            UF_DONT_EXPIRE_PASSWD = 0x10000,
            UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED = 0x80,
            UF_HOMEDIR_REQUIRED = 8,
            UF_INTERDOMAIN_TRUST_ACCOUNT = 0x800,
            UF_LOCKOUT = 0x10,
            UF_NORMAL_ACCOUNT = 0x200,
            UF_PASSWD_CANT_CHANGE = 0x40,
            UF_PASSWD_NOTREQD = 0x20,
            UF_SCRIPT = 1,
            UF_SERVER_TRUST_ACCOUNT = 0x2000,
            UF_TEMP_DUPLICATE_ACCOUNT = 0x100,
            UF_WORKSTATION_TRUST_ACCOUNT = 0x1000
        }
    }
}

